define(["jquery","picNum"],function($,picNum){
	return function(){
		$.ajax({
			url:"https://papi.lenovo.com.cn/batch/openapi/goods/recommend/mgetDetail/B00106?scenario=cart&terminal=1&laccid=_sk201908300149320.98308600.8026&_=1567733130343",
			dataType:"jsonp",
			jsonp:"jsonpCallback",
			success:function(data){
				//console.log(data.result.goodsDetails[picNum.buyCarNum[0]].detail.name);
				let msgIndex = 0;
				for(let i = 0;i<Array.from($(".items")).length;i++){
					//循环3个ul
					//console.log($($(".items")[i]).children().eq(0)[0]);
					for(let j = 0;j<4;j++){
						
						//循环填充4个li
						$($(".items")[i]).children().eq(j)[0].innerHTML = 
						`<li>
								<div class="item-imgs">
									<img src="${data.result.goodsDetails[picNum.buyCarNum[msgIndex]].detail.thumbnail}"/>
								</div>
								<div class="item-msg">
									<p>${data.result.goodsDetails[picNum.buyCarNum[msgIndex]].detail.name}</p>
									<span>￥${data.result.goodsDetails[picNum.buyCarNum[msgIndex]].detail.basePrice}</span>
								</div>
						</li>`;
						msgIndex++;
					}
					
				}
			}
		})
		
	}
})